package com.itheima.day06JDBC连接池JDBCTemplate.Demo1.JdbcTemplate课件;

import com.itheima.day06JDBC连接池JDBCTemplate.Demo1.domain课件.Emp;
import com.itheima.day06JDBC连接池JDBCTemplate.Demo1.utils.JDBCUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public class Test {
    public static void main(String[] args) {
        JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());

        String sql = "select count(id) from emp";
        Long total = template.queryForObject(sql, Long.class);
        System.out.println(total);
    }


}

